var gaifu_index = new Vue({
    el: '#gaifu_index',
    data: {
        show_zhezhao1: false,
        show_zhezhao2: false,
        show_zhezhao3: false,
        show_zhezhao4: false,
        show_zhezhao5: false
    },
    methods: {
        handleMouseEneter1: function () {
            this.show_zhezhao1 = true
        },
        handleMouseLeave1: function () {
            this.show_zhezhao1 = false
        },
        handleMouseEneter2: function () {
            this.show_zhezhao2 = true
        },
        handleMouseLeave2: function () {
            this.show_zhezhao2 = false
        },
        handleMouseEneter3: function () {
            this.show_zhezhao3 = true
        },
        handleMouseLeave3: function () {
            this.show_zhezhao3 = false
        },
        handleMouseEneter4: function () {
            this.show_zhezhao4 = true
        },
        handleMouseLeave4: function () {
            this.show_zhezhao4 = false
        },
        handleMouseEneter5: function () {
            this.show_zhezhao5 = true
        },
        handleMouseLeave5: function () {
            this.show_zhezhao5 = false
        }
    }
});

// <#--fixed 导航 start-->
var jumpToPart1 = function () {
    $('html, body').animate({
        scrollTop: $("#gaifu_index_line_one").offset().top
    }, 222);
    $(".nav_dot_inner").css("background-color", "#ededed");
    $("#nav_dot_inner1").css("background-color", "#e83e33");
}

var jumpToPart2 = function () {
    $('html, body').animate({
        scrollTop: $("#gaifu_index_line_three").offset().top
    }, 222);
    $(".nav_dot_inner").css("background-color", "#ededed");
    $("#nav_dot_inner2").css("background-color", "#e83e33");
}


var jumpToPart3 = function () {
    $('html, body').animate({
        scrollTop: $("#gaifu_index_line_four").offset().top
    }, 222);
    $(".nav_dot_inner").css("background-color", "#ededed");
    $("#nav_dot_inner3").css("background-color", "#e83e33");
}


$(document).ready(function () {
    $('html, body').animate({
        scrollTop: 0
    }, 222);

    // <#--监听滚轮事件，改变颜色-->
    // <#--https://www.jianshu.com/p/4bf613d8c927-->
    $(window).scroll(function () {
        //为了保证兼容性，这里取两个值，哪个有值取哪一个
        //scrollTop就是触发滚轮事件时滚轮的高度
        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
        var part2top = $("#gaifu_index_line_three").offset().top;
        var part3top = $("#gaifu_index_line_3_4").offset().top;
        if (scrollTop < part2top) {
            $(".nav_dot_inner").css("background-color", "#ededed");
            $("#nav_dot_inner1").css("background-color", "#e83e33");
        } else if (scrollTop < part3top) {
            $(".nav_dot_inner").css("background-color", "#ededed");
            $("#nav_dot_inner2").css("background-color", "#e83e33");
        } else {
            $(".nav_dot_inner").css("background-color", "#ededed");
            $("#nav_dot_inner3").css("background-color", "#e83e33");
        }
    })
});
// <#--fixed 导航 end-->